<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>admin - login</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="/public/plug/IconFont/style.css" />
		<link rel="stylesheet" href="/public/plug/SystemTips/SystemTips.css" />
		<link rel="stylesheet" href="/public/admin/css/login.css" />
	</head>

	<body>

		<div class="main bg-img">
			<div class="container">
				<div class="cont-head">
					<p class="tlt">后台管理系统</p>
				</div>
				<div class="cont-main">
					<form action="/*" method="post" onsubmit="return false;">
						<span>
							<label><i class="icon-user"></i></label>
							<input type="text" name="username" id="username" value="admin" />
						</span>
						<span>
							<label><i class="icon-password"></i></label>
							<input type="password" name="password" id="password" value="admin" />
						</span>
						<input type="submit" class="btn-submit" value="登录" />
					</form>
				</div>
			</div>
		</div>

		<script type="text/javascript" src="/public/admin/lib/jquery.1.12.3.min.js"></script>
		<script type="text/javascript" src="/public/modules/tool.js"></script>
		<script type="text/javascript" src="/public/modules/interactive.js"></script>
		<script type="text/javascript" src="/public/plug/SystemTips/SystemTips.js"></script>
		<script type="text/javascript">
			$(function() {
				$('.btn-submit').bind('click', function(e) {
					system.loading('加载中...');
					var data_opt = {
						'username': $('#username').val(),
						'password': $('#password').val()
					}
					ajax().post('/api?manager.login', data_opt, function(res) {
						system.loaded();
						if(res.status >= 200 && res.status < 300) {
							system.success('登录成功', function() {
								window.location.href = "/admin/system.html";
							});
						} else {
							system.error(res.error);
						}
					});
				});
			});
		</script>

	</body>

</html>